package org.moriraaca.google.interview;

import java.util.Arrays;
import java.util.Collection;

import junit.framework.Assert;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

@RunWith(Parameterized.class)
public class ExcelHelperTester {
	@Parameters
	public static Collection<Object[]> getParameters() {
		return Arrays.asList(new Object[] { 1, "A" }, new Object[] { 2, "B" },
				new Object[] { 26, "Z" }, new Object[] { 27, "AA" },
				new Object[] { 731, "ABC" });
	}

	int expected;

	String cell;

	public ExcelHelperTester(int expected, String cell) {
		this.expected = expected;
		this.cell = cell;
	}

	@Test
	public void testExcelHelper() {
		Assert.assertEquals(expected, new ExcelHelper().ordinal(cell));
	}
}
